/*
* value 定义全局变量，与service类似，区别于没有service的逻辑性，只是简单的代表变量数值
* */
angular.module('app').value('dict', {}).run(['dict', '$http', function(dict, $http) {
    ajax_city();
    ajax_salary();
    ajax_scale();
    function ajax_city () {
        var params = {};
        $http({
            url:'data/city.json',
            method:'GET',
            params:params,
            //data:params
        }).then(function (res) {
            dict.city = res.data;
        }, function (error) {
            console.log(error);
        });
    }
    function ajax_salary () {
        var params = {};
        $http({
            url:'data/salary.json',
            method:'GET',
            params:params,
            //data:params
        }).then(function (res) {
            dict.salary = res.data;
        }, function (error) {
            console.log(error);
        });
    }
    function ajax_scale () {
        var params = {};
        $http({
            url:'data/scale.json',
            method:'GET',
            params:params,
            //data:params
        }).then(function (res) {
            dict.scale = res.data;
        }, function (error) {
            console.log(error);
        });
    }
}]);